<html>
<head><meta charset="utf-8"><title>trait bounds for projected type · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/trait.20bounds.20for.20projected.20type.html">trait bounds for projected type</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="169353897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/trait%20bounds%20for%20projected%20type/near/169353897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/trait.20bounds.20for.20projected.20type.html#169353897">(Jun 30 2019 at 20:54)</a>:</h4>
<p>I've run into a situation where I'm trying to prove something along the lines of this: for some type <code>T</code>, <code>&lt;T as Future&gt;::Output == U where U: Try</code>. I know how to prove both <code>&lt;T as Future&gt;::Output</code> and <code>where U: Try</code> separately using <code>InferCtxt::predicate_may_hold</code>, but I don't know how to construct an obligation for both.</p>



<a name="169353956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/trait%20bounds%20for%20projected%20type/near/169353956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/trait.20bounds.20for.20projected.20type.html#169353956">(Jun 30 2019 at 20:56)</a>:</h4>
<p>Does anyone have any ideas about how I could go about doing this?</p>



<a name="170432808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/trait%20bounds%20for%20projected%20type/near/170432808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/trait.20bounds.20for.20projected.20type.html#170432808">(Jul 09 2019 at 08:16)</a>:</h4>
<p>I've also ran into situations where this would be useful, anyone have any ideas?</p>



<a name="170486772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/trait%20bounds%20for%20projected%20type/near/170486772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/trait.20bounds.20for.20projected.20type.html#170486772">(Jul 09 2019 at 20:14)</a>:</h4>
<p>I’ve made some attempts at this by including the <code>TraitPredicate</code> in the <code>param_env</code> of the <code>Obligation</code> with both the <code>TraitPredicate</code> and <code>ProjectionPredicate</code> referencing the same type variable but none of them have worked</p>



<a name="170486856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/trait%20bounds%20for%20projected%20type/near/170486856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/trait.20bounds.20for.20projected.20type.html#170486856">(Jul 09 2019 at 20:14)</a>:</h4>
<p>cc <span class="user-group-mention" data-user-group-id="692">@WG-traits</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>